#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int winningPlayerCount(int n, vector<vector<int>>& pick) {
        vector<vector<int>> balls(n, vector<int>(11));
        int res = 0;
        vector<bool> vis(n, false);
        for (auto vec : pick)
        {
            if (++balls[vec[0]][vec[1]] > vec[0] && vis[vec[0]] == false)
            {
                vis[vec[0]] = true;
                ++res;
            }
        }
        return res;
    }
};